﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace Customer360AutoJob.Core.Configuration
{
    public class SystemConfiguration
    {
        private static Guid applicationKey;
        public static Guid ApplicationKey
        {
            get
            {
                if (applicationKey != Guid.Empty) return applicationKey;
                var key = ConfigurationManager.AppSettings.AllKeys.FirstOrDefault(x => x == "ApplicationKey");
                if (!string.IsNullOrEmpty(key) && Guid.TryParse(ConfigurationManager.AppSettings[key], out applicationKey))
                    return applicationKey;
                return Guid.Empty;
            }
        }
    }
}